﻿using System;
using System.Collections.Generic;
using System.Text;
using Scripting;

    class ChatGMRequest : ScriptBase
    {
        ActorInfoRequest GMRequest;
        public void SetPlayerAsGM(string name)
        {
            GMRequest = new ActorInfoRequest(name, ActorInfoRequestState.Online);
            RegisterCallback(GMRequest, "Complete", new ActorInfoRequest.RequestHandler(GMRequest_Complete));
            RCScript.PostActorInfoRequest(GMRequest);

        }

        public void GMRequest_Complete(ActorInfo actorInfo)
        {
            if (actorInfo.State == ActorInfoState.Online)
            {
                Actor Player2 = actorInfo.Handle;
                Player2.GM = true;

            }
            UnRegisterCallback(GMRequest, "Complete", new ActorInfoRequest.RequestHandler(GMRequest_Complete));
        }

    }

